
<ul class="maintabmenu multipletabmenu">     
    <li class="current"><a href="<?php echo base_url();?>administrator/orders">Tất cả đơn hàng</a></li>
    <li><a href="<?php echo base_url();?>administrator/orders/add">Thêm mới đơn hàng</a></li>    
</ul>                   
<div class="content">
        <h1 id="ajaxtitle"></h1>                       	                            
    <div class="contenttitle radiusbottom0">
        <h2 class="table"><span>Danh sách đơn hàng</span></h2>
    </div><!--contenttitle-->
    <div class="tableoptions">
        <form name="frmfilter" method="post" action="<?php echo base_url();?>administrator/orders" >                        	
            <button class="deletebutton radius3" title="table2" name="delete_post" value="<?php echo base_url();?>admin/orders/delete">Delete Selected</button> &nbsp;
            <select name="restaurent_option">
                    <option value="0">-- Tất cả --</option>
                    <?php 
                        foreach ($list_restaurent as $res)
                        {
                    ?>
                    <option value="<?php echo $res->id;?>" <?php if($res->id == $restaurent) echo "selected='selected'";?>><?php echo $this->common->get_lang($res->name);?></option>
                    <?php }?>                    
            </select> &nbsp;
            <input type="text" value="<?php if($key_word!='~')echo $key_word;?>" name="txtKeyWord" class="input-keyword">&nbsp;
            <input type="submit" class="btn" value="Tìm kiếm"/>
        </form>
    </div><!--tableoptions-->	
    <table cellpadding="0" cellspacing="0" border="0" id="table2" class="stdtable stdtablecb">
        <colgroup>
            <col class="con0" />
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            <col class="con0" />
        </colgroup>
        <thead>
            <tr>
                <th class="head0" width="10"><input type="checkbox" class="checkall" /></th>
                <th class="head1">Mã đơn hàng</th>
                 <th class="head0">Khách hàng</th>
                <th class="head1">Nhà hàng</th>
                <th class="head0">Trạng thái</th>
                <td class="head1">Ngày tạo</td>
                <th class="head1" width="60">&nbsp;</th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th class="head0" width="10"><input type="checkbox" class="checkall" /></th>
                <th class="head1">Mã đơn hàng</th>
                 <th class="head0">Khách hàng</th>
                <th class="head1">Nhà hàng</th>
                <th class="head0">Trạng thái</th>
                <td class="head1">Ngày tạo</td>
                <th class="head1" width="60">&nbsp;</th>
            </tr>
        </tfoot>
        <tbody>
            <?php 
            foreach ($list_order as $order)
            {
            ?>
            <tr>
                <td class="center"><input value="<?php echo $order->id;?>" type="checkbox"></td>                
                <td><?php echo $order->name;?></td>
                <td><?php $customer = new Customer(); $customer->get_by_id($order->customer_id); echo $customer->name;?></td>
                <td><?php $res = new Restaurent(); $res->get_by_id($order->restaurent_id); echo $res->name;?></td>
                <td><?php echo $order->status;?></td>
                <td><?php echo date_format(date_create($order->create_date),'d-m-Y H:i:s');?></td>
                <td class="center">
                    <a class="edit" href="<?php echo base_url();?>administrator/orders/edit/<?php echo $order->id;?>">Sửa</a> &nbsp; 
                    <a class="delete" name="delete_post" id="<?php echo $order->id;?>" href="<?php echo base_url();?>administrator/orders/delete">Xóa</a>
                </td>
            </tr>
            <?php
            }
            ?>
        </tbody>
    </table>    
    <?php echo $list_link;?>       
</div><!--content-->